*************************************************************************************************
* Documentation for Reproduction of
* Midpoint Misperceptions on 1-to-10 Scales. 2011. 
* International Journal of Public Opinion Research 23(2): 205-213.
* L.J Zigerell
* Stata version 9
*************************************************************************************************
*************************************************************************************************
set more off
set mem 500m
* use "wvs2005merged.dta", clear [This is the command to load the dataset]
* the dataset used was the merged version of the 2005 World Values Survey
*************************************************************************************************
*************************************************************************************************
* delete all african nations because of confusion with a 1-to-10 scale
* see footnote 1 in the article
tab v2 if v2==15 | v2==56 | v2==89 | v2==90 | v2==110 | v2==111 | v2==112 | v2==113 | v2==114
drop if v2==15
drop if v2==56
drop if v2==89
drop if v2==90
drop if v2==110
drop if v2==111
drop if v2==112
drop if v2==113
drop if v2==114
tab v2
*************************************************************************************************
*************************************************************************************************
* india used 1-to-10 scales for v22 and v253 only
* this first set is for the items that india received 1-to-10 scales for

* the steps for each item are as follows:
* 1. tabulate the item to make sure that the item ranges from 1 to 10 with no missing data
* 2. get summary statistics that are reported in Table 1
* 3. generate a variable whose name starts with "five"
* 4. recode this "five" variable so that it is a dichotomous variable where 1 is a selection of 5 
*    and 0 is a selection of a number other than 5 on the scale
* 5. generate a variable whose name starts with "six"
* 6. recode this "six" variable so that it is a dichotomous variable where 1 is a selection of 6 
*    and 0 is a selection of a number other than 6 on the scale
* 7. conduct a test of proportion between the "five" variable and the "six" variable
* 8. conduct a t-test between the "five" variable and the "six" variable

tab v22
sum v22, de
gen five22 = v22
recode five22 (5=1) (1/4 6/10=0)
gen six22 = v22
recode six22 (6=1) (1/5 7/10=0)
prtest five22 = six22
ttest five22 = six22

tab v253
sum v253, de
gen five253 = v253
recode five253 (5=1) (1/4 6/10=0)
gen six253 = v253
recode six253 (6=1) (1/5 7/10=0)
prtest five253 = six253
ttest five253 = six253
*************************************************************************************************
* drop india from the analysis for the remaining questions
tab v2 if v2==32
drop if v2==32
*************************************************************************************************
*************************************************************************************************
* hong kong used four-point scales for v116 v117 v118 and v119
* this next set is for the items that hong kong received four-point scales for
* note: v2!=104 removes hong kong from the analysis
tab v2 if v2==104

tab v116 if v2!=104
sum v116 if v2!=104, de
gen five116 = v116 if v2!=104
recode five116 (5=1) (1/4 6/10=0)
gen six116 = v116
recode six116 (6=1) (1/5 7/10=0)
prtest five116 = six116 if v2!=104
ttest five116 = six116 if v2!=104

tab v117 if v2!=104
sum v117 if v2!=104, de
gen five117 = v117 if  v2!=104
recode five117 (5=1) (1/4 6/10=0)
gen six117 = v117
recode six117 (6=1) (1/5 7/10=0)
prtest five117 = six117 if v2!=104
ttest five117 = six117 if v2!=104

tab v118 if v2!=104
sum v118 if v2!=104, de
gen five118 = v118 if v2!=104
recode five118 (5=1) (1/4 6/10=0)
gen six118 = v118
recode six118 (6=1) (1/5 7/10=0)
prtest five118 = six118 if v2!=104
ttest five118 = six118 if v2!=104

tab v119 if v2!=104
sum v119 if v2!=104, de
gen five119 = v119 if v2!=104
recode five119 (5=1) (1/4 6/10=0)
gen six119 = v119
recode six119 (6=1) (1/5 7/10=0)
prtest five119 = six119 if v2!=104
ttest five119 = six119 if v2!=104
*************************************************************************************************
*************************************************************************************************
* this next set is for 1-to-10 items that hong kong and all other dataset countries received
* india and the african nations are not included in this analysis
tab v46
sum v46, de
gen five46 = v46
recode five46 (5=1) (1/4 6/10=0)
gen six46 = v46
recode six46 (6=1) (1/5 7/10=0)
prtest five46 = six46
ttest five46 = six46

tab v47
sum v47, de
gen five47 = v47
recode five47 (5=1) (1/4 6/10=0)
gen six47 = v47
recode six47 (6=1) (1/5 7/10=0)
prtest five47 = six47
ttest five47 = six47

tab v68
sum v68, de
gen five68 = v68
recode five68 (5=1) (1/4 6/10=0)
gen six68 = v68
recode six68 (6=1) (1/5 7/10=0)
prtest five68 = six68
ttest five68 = six68

tab v91
sum v91, de
gen five91 = v91
recode five91 (5=1) (1/4 6/10=0)
gen six91 = v91
recode six91 (6=1) (1/5 7/10=0)
prtest five91 = six91
ttest five91 = six91

tab v92
sum v92, de
gen five92 = v92
recode five92 (5=1) (1/4 6/10=0)
gen six92 = v92
recode six92 (6=1) (1/5 7/10=0)
prtest five92 = six92
ttest five92 = six92

tab v93
sum v93, de
gen five93 = v93
recode five93 (5=1) (1/4 6/10=0)
gen six93 = v93
recode six93 (6=1) (1/5 7/10=0)
prtest five93 = six93
ttest five93 = six93

tab v94
sum v94, de
gen five94 = v94
recode five94 (5=1) (1/4 6/10=0)
gen six94 = v94
recode six94 (6=1) (1/5 7/10=0)
prtest five94 = six94
ttest five94 = six94

tab v114
sum v114, de
gen five114 = v114
recode five114 (5=1) (1/4 6/10=0)
gen six114 = v114
recode six114 (6=1) (1/5 7/10=0)
prtest five114 = six114
ttest five114 = six114

tab v120
sum v120, de
gen five120 = v120
recode five120 (5=1) (1/4 6/10=0)
gen six120 = v120
recode six120 (6=1) (1/5 7/10=0)
prtest five120 = six120
ttest five120 = six120

tab v121
sum v121, de
gen five121 = v121
recode five121 (5=1) (1/4 6/10=0)
gen six121 = v121
recode six121 (6=1) (1/5 7/10=0)
prtest five121 = six121
ttest five121 = six121

tab v122
sum v122, de
gen five122 = v122
recode five122 (5=1) (1/4 6/10=0)
gen six122 = v122
recode six122 (6=1) (1/5 7/10=0)
prtest five122 = six122
ttest five122 = six122

tab v123
sum v123, de
gen five123 = v123
recode five123 (5=1) (1/4 6/10=0)
gen six123 = v123
recode six123 (6=1) (1/5 7/10=0)
prtest five123 = six123
ttest five123 = six123

tab v152
sum v152, de
gen five152 = v152
recode five152 (5=1) (1/4 6/10=0)
gen six152 = v152
recode six152 (6=1) (1/5 7/10=0)
prtest five152 = six152
ttest five152 = six152

tab v153
sum v153, de
gen five153 = v153
recode five153 (5=1) (1/4 6/10=0)
gen six153 = v153
recode six153 (6=1) (1/5 7/10=0)
prtest five153 = six153
ttest five153 = six153

tab v154
sum v154, de
gen five154 = v154
recode five154 (5=1) (1/4 6/10=0)
gen six154 = v154
recode six154 (6=1) (1/5 7/10=0)
prtest five154 = six154
ttest five154 = six154

tab v155
sum v155, de
gen five155 = v155
recode five155 (5=1) (1/4 6/10=0)
gen six155 = v155
recode six155 (6=1) (1/5 7/10=0)
prtest five155 = six155
ttest five155 = six155

tab v156
sum v156, de
gen five156 = v156
recode five156 (5=1) (1/4 6/10=0)
gen six156 = v156
recode six156 (6=1) (1/5 7/10=0)
prtest five156 = six156
ttest five156 = six156

tab v157
sum v157, de
gen five157 = v157
recode five157 (5=1) (1/4 6/10=0)
gen six157 = v157
recode six157 (6=1) (1/5 7/10=0)
prtest five157 = six157
ttest five157 = six157

tab v158
sum v158, de
gen five158 = v158
recode five158 (5=1) (1/4 6/10=0)
gen six158 = v158
recode six158 (6=1) (1/5 7/10=0)
prtest five158 = six158
ttest five158 = six158

tab v159
sum v159, de
gen five159 = v159
recode five159 (5=1) (1/4 6/10=0)
gen six159 = v159
recode six159 (6=1) (1/5 7/10=0)
prtest five159 = six159
ttest five159 = six159

tab v160
sum v160, de
gen five160 = v160
recode five160 (5=1) (1/4 6/10=0)
gen six160 = v160
recode six160 (6=1) (1/5 7/10=0)
prtest five160 = six160
ttest five160 = six160

tab v161
sum v161, de
gen five161 = v161
recode five161 (5=1) (1/4 6/10=0)
gen six161 = v161
recode six161 (6=1) (1/5 7/10=0)
prtest five161 = six161
ttest five161 = six161

tab v162
sum v162, de
gen five162 = v162
recode five162 (5=1) (1/4 6/10=0)
gen six162 = v162
recode six162 (6=1) (1/5 7/10=0)
prtest five162 = six162
ttest five162 = six162

tab v163
sum v163, de
gen five163 = v163
recode five163 (5=1) (1/4 6/10=0)
gen six163 = v163
recode six163 (6=1) (1/5 7/10=0)
prtest five163 = six163
ttest five163 = six163

tab v178
sum v178, de
gen five178 = v178
recode five178 (5=1) (1/4 6/10=0)
gen six178 = v178
recode six178 (6=1) (1/5 7/10=0)
prtest five178 = six178
ttest five178 = six178

tab v192
sum v192, de
gen five192 = v192
recode five192 (5=1) (1/4 6/10=0)
gen six192 = v192
recode six192 (6=1) (1/5 7/10=0)
prtest five192 = six192
ttest five192 = six192

tab v198
sum v198, de
gen five198 = v198
recode five198 (5=1) (1/4 6/10=0)
gen six198 = v198
recode six198 (6=1) (1/5 7/10=0)
prtest five198 = six198
ttest five198 = six198

tab v199
sum v199, de
gen five199 = v199
recode five199 (5=1) (1/4 6/10=0)
gen six199 = v199
recode six199 (6=1) (1/5 7/10=0)
prtest five199 = six199
ttest five199 = six199

tab v200
sum v200, de
gen five200 = v200
recode five200 (5=1) (1/4 6/10=0)
gen six200 = v200
recode six200 (6=1) (1/5 7/10=0)
prtest five200 = six200
ttest five200 = six200

tab v201
sum v201, de
gen five201 = v201
recode five201 (5=1) (1/4 6/10=0)
gen six201 = v201
recode six201 (6=1) (1/5 7/10=0)
prtest five201 = six201
ttest five201 = six201

tab v202
sum v202, de
gen five202 = v202
recode five202 (5=1) (1/4 6/10=0)
gen six202 = v202
recode six202 (6=1) (1/5 7/10=0)
prtest five202 = six202
ttest five202 = six202

tab v203
sum v203, de
gen five203 = v203
recode five203 (5=1) (1/4 6/10=0)
gen six203 = v203
recode six203 (6=1) (1/5 7/10=0)
prtest five203 = six203
ttest five203 = six203

tab v204
sum v204, de
gen five204 = v204
recode five204 (5=1) (1/4 6/10=0)
gen six204 = v204
recode six204 (6=1) (1/5 7/10=0)
prtest five204 = six204
ttest five204 = six204

tab v205
sum v205, de
gen five205 = v205
recode five205 (5=1) (1/4 6/10=0)
gen six205 = v205
recode six205 (6=1) (1/5 7/10=0)
prtest five205 = six205
ttest five205 = six205

tab v206
sum v206, de
gen five206 = v206
recode five206 (5=1) (1/4 6/10=0)
gen six206 = v206
recode six206 (6=1) (1/5 7/10=0)
prtest five206 = six206
ttest five206 = six206

tab v207
sum v207, de
gen five207 = v207
recode five207 (5=1) (1/4 6/10=0)
gen six207 = v207
recode six207 (6=1) (1/5 7/10=0)
prtest five207 = six207
ttest five207 = six207

tab v208
sum v208, de
gen five208 = v208
recode five208 (5=1) (1/4 6/10=0)
gen six208 = v208
recode six208 (6=1) (1/5 7/10=0)
prtest five208 = six208
ttest five208 = six208

tab v221
sum v221, de
gen five221 = v221
recode five221 (5=1) (1/4 6/10=0)
gen six221 = v221
recode six221 (6=1) (1/5 7/10=0)
prtest five221 = six221
ttest five221 = six221

tab v244
sum v244, de
gen five244 = v244
recode five244 (5=1) (1/4 6/10=0)
gen six244 = v244
recode six244 (6=1) (1/5 7/10=0)
prtest five244 = six244
ttest five244 = six244

tab v245
sum v245, de
gen five245 = v245
recode five245 (5=1) (1/4 6/10=0)
gen six245 = v245
recode six245 (6=1) (1/5 7/10=0)
prtest five245 = six245
ttest five245 = six245

tab v246
sum v246, de
gen five246 = v246
recode five246 (5=1) (1/4 6/10=0)
gen six246 = v246
recode six246 (6=1) (1/5 7/10=0)
prtest five246 = six246
ttest five246 = six246

*************************************************************************************************
* this next set is for Figure 1 and corresponding text on page 208 of the article

summ v198-v208 /* this command looks for a justifiable/not justifiable item with a mean near 5 */
egen divorce_mean = mean(v205), by(v2)
tabstat divorce_mean, by(v2)
tabstat divorce_mean if divorce_mean > 6, by(v2)
tabstat divorce_mean if divorce_mean < 5, by(v2)
tabstat divorce_mean if divorce_mean < 6 & divorce_mean > 5, by(v2)

tab v205 if divorce_mean < 5 /* this command provides data in Figure 1 */
tab v205 if divorce_mean < 6 & divorce_mean > 5 /* this command provides data in Figure 1 */
tab v205 if divorce_mean > 6 /* this command provides data in Figure 1 */

gen div5 = v205
recode div5 (5=1) (1/4 6/10=0)
gen div6 = v205
recode div6 (6=1) (1/5 7/10=0)
prtest div5 = div6 if divorce_mean > 6
prtest div5 = div6 if divorce_mean < 5
prtest div5 = div6 if divorce_mean < 6 & divorce_mean > 5
ttest div5 = div6 if divorce_mean > 6
ttest div5 = div6 if divorce_mean < 5
ttest div5 = div6 if divorce_mean < 6 & divorce_mean > 5
*************************************************************************************************
